package com.cares.android.sudoku;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class BitmapUtils {

	public static final int[] imagesNumFixed= {
		R.drawable.n0,
		R.drawable.n1,
		R.drawable.n2,
		R.drawable.n3,
		R.drawable.n4,
		R.drawable.n5,
		R.drawable.n6,
		R.drawable.n7,
		R.drawable.n8,
		R.drawable.n9
	};
	
	public static final int[]  imagesNumUnfixed = {
		R.drawable.n_a_00,
		R.drawable.n_a_01,
		R.drawable.n_a_02,
		R.drawable.n_a_03,
		R.drawable.n_a_04,
		R.drawable.n_a_05,
		R.drawable.n_a_06,
		R.drawable.n_a_07,
		R.drawable.n_a_08,
		R.drawable.n_a_09
	};
	
	public static Bitmap getBitmap(Resources res, NumberCell numCell) {
		if (numCell.isFixed()) {
			return BitmapFactory.decodeResource(res, imagesNumFixed[numCell.getNumber()]);
		} else {
			return BitmapFactory.decodeResource(res, imagesNumUnfixed[numCell.getNumber()]);
		}
	}
	
	public static Bitmap getBitmap(Resources res, int imageID) {
		return BitmapFactory.decodeResource(res, imageID);
	}
}
